SmartToolkit

Plugins Development Manual

Contents

  1. List of Manual
  2. Basics Sintax
  3. Variables
  4. Constants / Defined
  5. Expressions
  6. Tag Name Reference
  7. Constants Reference
This Manual is not completed yet. Learn the sample plugin if you want to more understand..

List of Manual

  1. General SmartToolkit Manual
  2. Language Development Notes
  3. Plugins Development Manual
  4. Skins Development Manual
  5. Changelogs

Basics Sintax

SmartToolkit Plugin Script is tags based script, but it is different from xml or html script.

Tags

There is 3 tag type: Tag with parameters, Tag without parameter and Close Tag.

  1. Tag with parameters:
    <tagname:param1,param2,param3,...>
  2. Tag without parameter:
    <tagname>
  3. Close Tag:
    </tagname>

NOTE: Tag Name is not case sensitive, so <head> is same with <HeAD>

Structures

stkplugin

Variables

SmartToolkit Plugin Script Variables only can be use in parameter.

Naming the Variables

To define the statement as variable, you need to insert the dollar prefix $ before name of variable.

You can use any alpha numeric or some other characters for your variables name. It safe to only use alpha numeric and underscore.

NOTE: The name of variable is case sensitive

Type of Variable

SmartToolkit only support 2 variable type ( String and Integer ). All variables is type juggling, it may automatically change the current variable type to another type if you use some command.

Example:
<set:$var1,1> This will set $var1 with integer(1)
<set:$var1,$var1+"40"> This will set $var1 with integet(41)
<append:$var," Test"> This will set $var1 wirh string("41 Test")

More Example:
<set:$var1,"abc 40 def 50"> This will set $var1 as string
<set:$var1,$var1+50> This will set $var1 as integer with value 4100

Type juggling String to Integer on SmartToolkit will take the numeric characters and delete the alpha character like on the second example.

Remarks:


 

Range of Variable

There is no absolute range for string variables, it depend with the current phone memory, but for integer variables you can only use the value between -1000000000 to 1000000000.

Example:
<set:$var,"1234567890"> = string("1234567890")
<set=$var,$var+0> = integer(234567890)

NOTE: SmartToolkit alwalys take right to left string->integer converter, so be aware if you use the big numeric variable.

Boolean

There is no absolute boolean type in SmartToolkit. For comparison routine, you can use the alternative value:

Set The Sariables

You can set the variables values with set tag. The first parameter is variable buffer, and the second parameter is values which will be set into the variable.

Example:
<set:$var,"Set the string">
<set:$var,400>

Constants / Defined

Constant values on SmartToolkit not mean Still Values, it more fit if we call it defined values. You cannot change the value by script, but it may change if current phone state is change.

To define the statement as constants, you need to insert the at sign prefix @ before name of constants.

Example:
@constant_name

NOTE: The name of Constants / Defined is case sensitive. See the Constants Reference to know all defined constants.

Expressions

Expressions is manipulation values of tag's parameters. To define the parameter as expressions, you need to insert the prefix ( before the expression statements and postfix ) after the expression statements.

Example:
($statement1+$statement2-@statement3)
($statement1>$statement2)
(($statement1)&&($statement2))

Comparison Operators

Example Name Result
$a=$bEqualTRUE if $a is equal $b
$a==$bEqualTRUE if $a is equal $b
$a!=$bNot EqualTRUE if $a is not equal $b
$a!$bNot EqualTRUE if $a is not equal $b
$a<>$bNot EqualTRUE if $a is not equal $b
$a<$bLess thanTRUE if $a is less than $b
$a>$bGreater thanTRUE if $a is greater than $b
$a<=$bLess or equalTRUE if $a is less or equal than $b
$a>=$bGreater or equalTRUE if $a is greater or equal than $b

Logical Operators

Example Name Result
!$aNotTRUE if $a is not TRUE.
$a && $bAndTRUE if both $a and $b are TRUE
$a & $bAndTRUE if both $a and $b are TRUE
$a || $bOrTRUE if either $a or $b is TRUE
$a | $bOrTRUE if either $a or $b is TRUE
$a ^ $bXorTRUE if either $a or $b is TRUE, but not both.

Arithmetic Operators

Example Name Result
$a + $bAdditionSum of $a and $b
$a - $bSubtractionDifference of $a and $b
$a * $bMultiplicationProduct of $a and $b
$a / $bDivisionQuotient of $a and $b
$a % $bModulusRemainder of $a divided by $b

Tag Name Reference

!! SUBJECT TO CHANGE !!

Section Tags

Tags Function
<stkplugin></stkplugin>Plugins Definition
<action></action>Action callback
<main></main>Main body ( Interface )

Context Tags

Tags Function
<if><else></if>Comparison
<while></while>Looping [EXPERIMENTAL]
<set>Define the variables
<string>Manipulation string
<header>Set the header informations
<getparam>Get Parameters ( like querys on http )
<reg_get>Get Registry values into variables
<reg_set>Set Registry values
<stringres> Get SmartToolkit string resource into variable ( in languages file )

Interface Tags

Tags Function
<echo> or <print>Flush the string into screen
<button>Draw the buttons ( action callback or file links )
<link></link>Define the link ( action callback or file links )
<b></b><i></i><u></u>Text & Font formatting
<hr>Horizontal line
<br>Break
<fontsize>Set Font size
<textcolor>Set Text Color
<bgcolor>Set Background ( maybe not supporting in full version )
<align>Set Text align
<img>Show images ( png, bmp, jpg, gif )
<draw>Drawing something ( value bar, line, trackbar, etc )

Action Tags

Tags Function
<go>Go to another plugin file file
<exec>Run the application
<system>Start the system functions ( reboot, shutdown, etc )
<sendmessage>Send messages into window
<close>Close the plugin window

Constants Reference

!! SUBJECT TO CHANGE !!

@true, @false, @APP_VER, @APP_BUILD, @APP_COPY, @APP_COMPANY, @APP_NAME, @APP_LANG, @Mem_TotalPhys, @Mem_AvailPhys, @Mem_MemoryLoad, @ACLineStatus, @BatteryFlag, @BatteryLifePercent @BatteryLifeTime, @BatteryFullLifeTime, @BackupBatteryFlag, @BackupBatteryLifePercent, @BackupBatteryLifeTime, @BackupBatteryFullLifeTime, @BatteryVoltage, @BatteryCurrent, @BatteryAverageCurrent, @BatteryAverageInterval, @BatterymAHourConsumed, @BatteryTemperature, @BackupBatteryVoltage, @BatteryChemistry, @Screen_Width, @Screen_Height, @Screen_ClientWidth, @Screen_ClientHeight, @Screen_BarHeight, @Screen_SmallIconWidth, @Screen_SmallIconHeight, @Screen_BigIconWidth, @Screen_BigIconHeight, @Screen_PluginWidth, @Screen_PluginHeight, @Screen_ScrollbarHSize, @Screen_ScrollbarVSize, @SysYear, @SysMonth, @SysDayOfWeek, @SysDay, @SysHour, @SysMinute, @SysSecond, @SysMilliseconds, @LocalYear, @LocalMonth, @LocalDayOfWeek, @LocalDay, @LocalHour, @LocalMinute, @LocalSecond, @LocalMilliseconds